function DispSymMatrixMatlab_file_vector(AA,NAME,nameOfFunction)

if ndims(AA) == 2
    N1 = size(AA,1);
    N2 = size(AA,2);
    N3 = 1;
    N4 = 1;
elseif ndims(AA) == 3
    N1 = size(AA,1);
    N2 = size(AA,2);
    N3 = size(AA,3);
    N4 = 1;
elseif ndims(AA) == 4
    N1 = size(AA,1);
    N2 = size(AA,2);
    N3 = size(AA,3);
    N4 = size(AA,4);
end
text = ['% START DISPLAYING ' NAME];
dlmwrite(nameOfFunction,text,'-append','delimiter','');
for g=1:N4
    for k=1:N3
        for j=1:N2
            if any(AA(:,j,k,g) ~= 0)
                for i=1:N1
                    if AA(i,j,k,g) ~= 0
                         TEMP = char(AA(i,j,k,g));
                         % Replacing ^ with **,exp with EXP and log with LOG
                         TEMP = strrep(TEMP,'*','.*');
                         TEMP = strrep(TEMP,'/','./');
                         TEMP = strrep(TEMP,'^','.^');
                         if ndims(AA) == 2
                             if j == 1
                                text = [NAME '(' num2str(i) ',:)=' TEMP ';'];
                             else
                                text = [NAME '(' num2str(i) ',' num2str(j) ',:)=' TEMP ';'];
                             end
                         elseif ndims(AA) == 3
                             text = [NAME '(' num2str(i) ',' num2str(j) ',' num2str(k) ',:)=' TEMP ';'];
                         elseif ndims(AA) == 4
                             text = [NAME '(' num2str(i) ',' num2str(j) ',' num2str(k) ',' num2str(g) ',:)=' TEMP ';'];
                         end
                        dlmwrite(nameOfFunction,text,'-append','delimiter','');
                    end
                end
            end
        end
    end
end
text = ['% END DISPLAYING ' NAME];
dlmwrite(nameOfFunction,text,'-append','delimiter','');
end
